﻿@model ScmCostactualViewModel
@{
    Layout = null;
    ViewBag.Title = "费用使用-修改";
    int num = 1;
}
<script src="/Scripts/jQuery/jquery.validate.min.js" type="text/javascript"></script>
<script src="/Scripts/jQuery/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
<script type="text/javascript">
    function dialogRefresh(json) {
        DWZ.ajaxDone(json);
        if (json.statusCode == DWZ.statusCode.ok) {
            $("#pagerForm", navTab.getCurrentPanel()).submit();
            $.pdialog.closeCurrent();
        }
    }
</script>
@{Html.EnableClientValidation();}
@using (Html.BeginForm("CostActualEditData", "ScmCostActual", null, FormMethod.Post, new { onsubmit = "return validateCallback(this,dialogRefresh);", @class = "pageForm required-validate" }))
{
    <div class="pageContent">
        <div class="pageFormContent" layouth="60">
            <dl>
                <dt style="text-align:right">施工单位：</dt>
                <dd>
                    @Html.TextBoxFor(m => m.TheScmCostactualmainInfo.Cam_ConstructionID, new { @type = "hidden" })
                    @Html.TextBoxFor(m => m.TheScmCostactualmainInfo.Cam_ConstructionName, new { @class = "required", @readonly = "readonly" })
                    <a class="btnLook" href="@Url.Action("UnitList", "ProjectSegment", new { uId = "TheScmCostactualmainInfo_Cam_ConstructionID", uName = "TheScmCostactualmainInfo_Cam_ConstructionName", uSection = "TheScmCostactualmainInfo_Cam_Section" })" lookupgroup="TheScmCostactualmainInfo" title="选择施工单位">查找带回</a>
                </dd>

            </dl>
             <dl>
                <dt style="text-align:right">标段：</dt>
                <dd>
                @Html.TextBoxFor(model => model.TheScmCostactualmainInfo.Cam_ID, new { @type = "hidden", @readonly = "readonly" })
                    @Html.TextBoxFor(model => model.TheScmCostactualmainInfo.Cam_Section)
            </dl>
            <dl>
                <dt style="text-align:right">上报时间：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.TheScmCostactualmainInfo.Cam_ReportTime,
                    new { @class = "date", @readonly = "readonly", Value = Model.TheScmCostactualmainInfo.Cam_ReportTime.ToString("yyyy-MM-dd") })
                </dd>
            </dl>
            <dl>
                <dt style="text-align:right">年份：</dt>
                <dd>
                @Html.TextBoxFor(model => model.TheScmCostactualmainInfo.Cam_YearMonth,
                             new { @class = "date", @readonly = "readonly", format = "yyyy-MM", Value = Model.TheScmCostactualmainInfo.Cam_YearMonth.ToString("yyyy-MM") })
                    @Html.ValidationMessageFor(m => m.TheScmCostactualmainInfo.Cam_YearMonth)
                    </dd>
            </dl>
            <div class="divider"></div>
            <div class="panelBar">

                <ul class="toolBar">
                    <li class="nobg"><b>费用统计表</b></li>
                </ul>

            </div>
                
                        <table class="tables tables-bordered tables-hover itemDetail" addbutton="新增" width="100%">
                            <thead>
                                <tr>

                                    <th type="text" name="TheCostActualList[#index#].itemInt" defaultval="#index#" size="6" fieldclass="digits">序号</th>
                                    <th type="text" name="TheCostActualList[#index#].Ca_Item" size="50" >凭证名目</th>
                                    <th type="text" name="TheCostActualList[#index#].Ca_Amount" defaultval="0.0" size="12" fieldclass="number">金额</th>
                                    <th type="date" name="TheCostActualList[#index#].Ca_InvoiceDate" size="15">开票日期</th>
                                    <th type="text" name="TheCostActualList[#index#].Ca_InvoiceNumb" size="15">发票编号</th>
                                    <th type="text" name="TheCostActualList[#index#].Ca_Remark" size="40">备注</th>
                                    <th type="del" width="60">删除</th>

                                </tr>

                            </thead>
                            <tbody>
                                @for (int index = 0; index < Model.TheCostActualList.Count; index++)
                                {

                                    <tr>
                                        <td>
                                            <input type="text" style="width:90%;  margin:auto auto auto 2px;"  name="TheCostActualList[@index].itemInt" value=@num value="1" size="6" fieldclass="digits"></input>
                                        </td>
                                        <td>
                                            <input type="text" size="50" style="width:90%;  margin:auto auto auto 2px;" class=" textInput" name="TheCostActualList[@index].Ca_Item" value=@Model.TheCostActualList[index].Ca_Item></input>
                                        </td>
                                        <td>
                                            <input type="text" size="12" style="width:90%;  margin:auto auto auto 2px;" fieldclass="number" name="TheCostActualList[@index].Ca_Amount" value=@Model.TheCostActualList[index].Ca_Amount></input>
                                        </td>
                                        <td>
                                            <input type="text" class="date textInput" format="yyyy-MM-dd" defaultval="" size="15" name="TheCostActualList[@index].Ca_InvoiceDate" value=@Model.TheCostActualList[index].Ca_InvoiceDate.ToString("yyyy-MM-dd")></input>
                                            <a class="inputDateButton" href="javascript:void(0)">选择</a>
                                        </td>
                                        <td>
                                            <input type="text" size="15" style="width:90%;  margin:auto auto auto 2px;" fieldclass="number" name="TheCostActualList[@index].Ca_InvoiceNumb" value=@Model.TheCostActualList[index].Ca_InvoiceNumb></input>
                                        </td>
                                        <td>
                                            <input type="text" style="width:90%;  margin:auto auto auto 2px;" name="TheCostActualList[@index].Ca_Remark" size="40" value=@Model.TheCostActualList[index].Ca_Remark></input>
                                        </td>
                                        <td><a href="javascript:void(0)" class="btnDel ">删除</a></td>

                                    </tr>
                                    num++;
                                }


                            </tbody>
                        </table>
                    
                <div class="tabsFooter">
                    <div class="tabsFooterContent"></div>
                </div>
            </div>
        </div>
        <div class="formBar">
            <ul>
               <li>
                        <button type="submit" class="btn btn-sm">保存</button>
                    </li>
                <li>
                    <button type="button" class="close btn btn-default btn-sm">取消</button>
                </li>

            </ul>
        </div>
}

